////////////////////////////////////////////////////////////////////////////////
// Filename: L_dx11resourcemanager.cpp
////////////////////////////////////////////////////////////////////////////////
#include "L_dx11resourcemanager.h"

L_DX11ResourceManager::L_DX11ResourceManager()
{

}

L_DX11ResourceManager::~L_DX11ResourceManager()
{

}

void L_DX11ResourceManager::Init(ID3D11Device* tDevice)
{
	Device = tDevice;
}

bool L_DX11ResourceManager::InitTexture(string FileName)
{
	HRESULT hr;

	Textures[FileName] = 0;
	hr = D3DX11CreateShaderResourceViewFromFile( Device, FileName.c_str(), NULL, NULL, &Textures[FileName], NULL );
	if(FAILED(hr))
	{
		MessageBox(NULL, "Error creating texture", "Error", MB_OK | MB_ICONERROR);
		return false;
	}

	return true;
}

ID3D11ShaderResourceView* L_DX11ResourceManager::GetTexture(string FileName)
{
	return Textures[FileName];
}